<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix' => 'v1/admin_api','middleware'=>'admin_api_auth'], function ($router) {
	//登录
	Route::post('auth/login/login', 'v1\LoginController@login');
	//获取配置信息
	Route::get('auth/auth_config/config_info', 'v1\ConfigController@config_info');
/***********************************首页***************************************/	
	//刷新token
	Route::put('auth/index/refresh', 'v1\IndexController@refresh');
	//退出登录
	Route::delete('auth/index/logout', 'v1\IndexController@logout');
	//清除缓存
	Route::delete('auth/index/out_cache', 'v1\IndexController@out_cache');
	//获取左侧栏
	Route::get('auth/index/menu', 'v1\IndexController@menu');
	//修改密码
	Route::put('auth/index/upadte_pwd_view', 'v1\IndexController@upadte_pwd_view');
	//单图上传
	Route::post('auth/upload/file_image', 'v1\UploadController@file_image');
	//获取平台信息
	Route::get('auth/index/main', 'v1\IndexController@main');
/***********************************管理员列表***************************************/	
	//列表数据
	Route::get('auth/auth_admin/index', 'v1\AuthAdminController@index');
	//获取权限组
	Route::get('auth/auth_admin/group_list', 'v1\AuthAdminController@group_list');
	//添加
	Route::post('auth/auth_admin/store', 'v1\AuthAdminController@store');
	//编辑页面
	Route::get('auth/auth_admin/edit', 'v1\AuthAdminController@edit');
	//编辑提交
	Route::put('auth/auth_admin/update', 'v1\AuthAdminController@update');
	//调整状态
	Route::put('auth/auth_admin/status', 'v1\AuthAdminController@status');
	//初始化密码
	Route::put('auth/auth_admin/update_pwd', 'v1\AuthAdminController@update_pwd');
	
/***********************************权限组列表***************************************/	
	//列表数据
	Route::get('auth/auth_group/index', 'v1\AuthGroupController@index');
	//添加
	Route::post('auth/auth_group/store', 'v1\AuthGroupController@store');
	//编辑页面
	Route::get('auth/auth_group/edit', 'v1\AuthGroupController@edit');
	//编辑提交
	Route::put('auth/auth_group/update', 'v1\AuthGroupController@update');
	//调整状态
	Route::put('auth/auth_group/status', 'v1\AuthGroupController@status');
	//分配权限
	Route::get('auth/auth_group/access', 'v1\AuthGroupController@access');
	//分配权限提交
	Route::put('auth/auth_group/access_update', 'v1\AuthGroupController@access_update');
	
/***********************************权限列表***************************************/	
	//列表数据
	Route::get('auth/auth_rule/index', 'v1\AuthRuleController@index');
	//添加
	Route::post('auth/auth_rule/store', 'v1\AuthRuleController@store');
	//添加子级
	Route::post('auth/auth_rule/create_sublevel', 'v1\AuthRuleController@create_sublevel');
	//编辑页面
	Route::get('auth/auth_rule/edit', 'v1\AuthRuleController@edit');
	//编辑提交
	Route::put('auth/auth_rule/update', 'v1\AuthRuleController@update');
	//菜单状态
	Route::put('auth/auth_rule/status', 'v1\AuthRuleController@status');
	//是否验证权限
	Route::put('auth/auth_rule/auth_open', 'v1\AuthRuleController@auth_open');
	//排序
	Route::put('auth/auth_rule/sorts', 'v1\AuthRuleController@sorts');
	//删除
	Route::delete('auth/auth_rule/destroy', 'v1\AuthRuleController@destroy');
	
/***********************************系统配置***************************************/	
	//系统配置
	Route::get('auth/auth_config/index', 'v1\ConfigController@index');
	//提交
	Route::put('auth/auth_config/update', 'v1\ConfigController@update');	
/***********************************地区列表***************************************/	
	//地区列表
	Route::get('auth/area/index', 'v1\AuthAreaController@index');
	//添加
	Route::post('auth/area/store', 'v1\AuthAreaController@store');
	//编辑页面
	Route::get('auth/area/edit', 'v1\AuthAreaController@edit');
	//编辑提交
	Route::put('auth/area/update', 'v1\AuthAreaController@update');
	//状态
	Route::put('auth/area/status', 'v1\AuthAreaController@status');
	//排序
	Route::put('auth/area/sorts', 'v1\AuthAreaController@sorts');
	//导入服务器数据
	Route::post('auth/area/import_data', 'v1\AuthAreaController@import_data');
});